package com.rc.saas.mini.service.tenant;

import com.rc.saas.mini.mapper.tenant.TenantBannerMapper;
import com.rc.saas.mini.model.tenant.TenantBanner;
import com.rc.saas.mini.model.tenant.TenantBannerExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TenantBannerServiceImpl implements TenantBannerService {

    @Autowired
    private TenantBannerMapper tenantBannerMapper;

    @Override
    public TenantBannerMapper getMapper() {
        return tenantBannerMapper;
    }

    @Override
    public List<TenantBanner> selectByTenantCode(String tenantCode) {
        TenantBannerExample example = new TenantBannerExample();
        example.createCriteria().andTenantCodeEqualTo(tenantCode)
                .andBannerTypeEqualTo("2")
                .andMiniIndexImgIsNotNull()
                .andStatusEqualTo("1");
        return tenantBannerMapper.selectByExample(example);
    }
}
